package com.zhuangjie.order.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author zhuangjie
 * @since 2023-11-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("`order`")
@ApiModel(value = "Order对象", description = "订单表")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键编号")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "订单号")
    @TableField("order_no")
    private String orderNo;

//    @ApiModelProperty(value = "菜品内容生成的key")
//    @TableField("order_key")
//    private String orderKey;

    @ApiModelProperty(value = "商家/商店_店铺id")
    @TableField("shop_id")
    private Long shopId;

    @ApiModelProperty(value = "用户表_用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "提取码/座位号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "订单金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "订单状态（1待支付 2待接单 3已接单 4派送中/制作完成  5已完成 6申请售后 7已取消）")
    @TableField("state")
    private Integer state;

    @ApiModelProperty(value = "支付方式（1微信支付  2支付宝支付）")
    @TableField("pay_method")
    private Integer payMethod;

    @ApiModelProperty(value = "支付状态（0未支付 1已支付 2退款）")
    @TableField("pay_status")
    private Integer payStatus;

    @ApiModelProperty(value = "付款超时时间")
    @TableField("pay_timeout_time")
    private LocalDateTime payTimeoutTime;

    @ApiModelProperty(value = "付款时间")
    @TableField("pay_time")
    private LocalDateTime payTime;

    @ApiModelProperty(value = "备注信息")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "订单取消原因")
    @TableField("cancel_reason")
    private String cancelReason;

    @ApiModelProperty(value = "拒单原因")
    @TableField("rejection_reason")
    private String rejectionReason;

    @ApiModelProperty(value = "用户指定的送达时间")
    @TableField("designated_delivery_time")
    private LocalDateTime designatedDeliveryTime;

    @ApiModelProperty(value = "估计需要的配送-时长")
    @TableField("delivery_duration")
    private Integer deliveryDuration;

    @ApiModelProperty(value = "估计的送达时间")
    @TableField("estimated_delivery_time")
    private LocalDateTime estimatedDeliveryTime;

//    @ApiModelProperty(value = "是否立即单（1立即送出  0选择具体时间）")
//    @TableField("is_immediate")
//    private Integer isImmediate;


//    @ApiModelProperty(value = "打包费")
//    @TableField("packing_fee")
//    private BigDecimal packingFee;
//
//    @ApiModelProperty(value = "店家设置的配送费")
//    @TableField("delivery_fee")
//    private BigDecimal deliveryFee;
//
//    @ApiModelProperty(value = "收货人")
//    @TableField("consignee")
//    private String consignee;
//
//    @ApiModelProperty(value = "收货人手机号")
//    @TableField("phone")
//    private String phone;

    @ApiModelProperty(value = "收货方式-取货方式(1店食、2自提、3配送)")
    @TableField("receiving_method")
    private String receivingMethod;

    @ApiModelProperty(value = "配送方式（1平台配送，2商家配送）")
    @TableField("delivery_method")
    private Short deliveryMethod;

//    @ApiModelProperty(value = "菜品枚举方式描述(菜品名1,菜品名2,...),为了不连表操作，冗余来用于订单搜索")
//    @TableField("dishes")
//    private String dishes;
//
//    @ApiModelProperty("店铺名称")
//    @TableField("shop_name")
//    private String shopName;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
